describe('正则表达式', () => {
    it('test1', () => {
        let pattern = /[0-9]{4}(-[0-9]{2}){2}/g;
        let str = "111 2019-07-12 09:27:00 2019-07-13 2019-05-12";
        // let c = pattern.exec(str);
        console.log(str.match(pattern));
    });

    it('test2', () => {
        var regEn = /[`~!@#$%^&*()_+<>?:"{},.\/;'[\]]/im,
            regCn = /[·！#￥（——）：；“”‘、，|《。》？、【】[\]]/im;

        function check(newName) {
            if (regEn.test(newName) || regCn.test(newName)) {
                console.log("名称不能包含特殊字符.");
                return false;
            }
            return true;
        }

        var res = check("12345\!");
        console.log(res)
    });
});